//
// Created by 魏小鹏 on 2019-10-05.
//
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

class Solution1 {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        long len = nums.size();
        for (int i = 0; i < len - 1; ++i) {
            for (int j = i + 1; j < len; ++j) {
                if (nums[i] + nums[j] == target) {
                    vector<int> res = { i, j };
                    return res;
                }
            }
        }
        return vector<int>(0);
    }
};

int main() {
    vector<int> nums = { -1,-2,-3,-4,-5 };
    vector<int> res = Solution1().twoSum(nums, -8);
    for (int re : res) {
        cout << re << endl;
    }
}